|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sponsorpay.sdk.android.advertiser.SponsorPayAdvertiser
public class SponsorPayAdvertiser
Provides convenience calls to run the Advertiser callback request. Manages the state of the SDK determining whether a successful response to the callback request has been already received since the application was installed in the host device.
It's implemented as a singleton, and its public methods are static.
Field Summary | |
---|---|
private AdvertiserCallbackSender |
mAPICaller
AdvertiserCallbackSender used to call the Advertiser API asynchronously. |
private Context |
mContext
Host app's Android application context. |
private HostInfo |
mHostInfo
AdvertiserHostInfo used to collect data related to the host device and application. |
private static SponsorPayAdvertiser |
mInstance
Singleton instance. |
private SharedPreferences |
mPrefs
The shared preferences encoded in the PREFERENCES_FILE_NAME file. |
private static java.lang.String |
PREFERENCES_FILE_NAME
Shared preferences file name. |
private static boolean |
sShouldUseStagingUrls
|
private static java.lang.String |
STATE_GOT_SUCCESSFUL_RESPONSE_KEY
The key to store in the preferences file the flag which determines if we have already successfully contacted the Advertiser API. |
Constructor Summary | |
---|---|
private |
SponsorPayAdvertiser(Context context)
Constructor. |
Method Summary | |
---|---|
void |
onAPIResponse(boolean wasSuccessful)
This method is invoked when a response for the advertiser callback is received. |
private void |
register()
Calls its overload register() with an empty overrideAppId parameter. |
static void |
register(Context context)
Trigger the Advertiser callback. |
static void |
register(Context context,
java.lang.String overrideAppId)
Trigger the Advertiser callback. |
static void |
registerWithDelay(Context context,
int delayMin)
Trigger the Advertiser callback after the specified delay has passed. |
static void |
registerWithDelay(Context context,
int delayMin,
java.lang.String overrideAppId)
Trigger the Advertiser callback after the specified delay has passed. |
static void |
setShouldUseStagingUrls(boolean value)
|
static boolean |
shouldUseStagingUrls()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String PREFERENCES_FILE_NAME
register()
, to keep track of whether we have already successfully contacted the Advertiser
API.
private static final java.lang.String STATE_GOT_SUCCESSFUL_RESPONSE_KEY
private SharedPreferences mPrefs
PREFERENCES_FILE_NAME
file.
private static boolean sShouldUseStagingUrls
private HostInfo mHostInfo
AdvertiserHostInfo
used to collect data related to the host device and application.
private AdvertiserCallbackSender mAPICaller
AdvertiserCallbackSender
used to call the Advertiser API asynchronously.
private Context mContext
private static SponsorPayAdvertiser mInstance
Constructor Detail |
---|
private SponsorPayAdvertiser(Context context)
context
- The host application context.Method Detail |
---|
public static void setShouldUseStagingUrls(boolean value)
public static boolean shouldUseStagingUrls()
public static void register(Context context)
context
- Host application context.public static void registerWithDelay(Context context, int delayMin)
context
- Host application context.delayMin
- The delay in minutes for triggering the Advertiser callback.public static void registerWithDelay(Context context, int delayMin, java.lang.String overrideAppId)
context
- Host application context.delayMin
- The delay in minutes for triggering the Advertiser callback.overrideAppId
- The App ID to use.public static void register(Context context, java.lang.String overrideAppId)
context
- Host application context.overrideAppId
- The App ID to use.private void register()
register()
with an empty overrideAppId parameter.
public void onAPIResponse(boolean wasSuccessful)
onAPIResponse
in interface AdvertiserCallbackSender.APIResultListener
wasSuccessful
- status flag if the Advertiser API has been contacted successfully
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |